update system time immediately when VCPUOP_register_vcpu_info
authorDongli Zhang <dongli.zhang@oracle.com>
Fri, 19 Nov 2021 08:39:09 +0000 (09:39 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 19 Nov 2021 08:39:09 +0000 (09:39 +0100)
commitc3f25903696412b8847619ccd5e51886106b70ad
treebd3e5a56f6ed6b9f964a09ef4f63bdbd7b8af88c
parent81e3fd1f3cacda220e4d46bb01f9c1b554ed8401
update system time immediately when VCPUOP_register_vcpu_info

The guest may access the pv vcpu_time_info immediately after
VCPUOP_register_vcpu_info. This is to borrow the idea of
VCPUOP_register_vcpu_time_memory_area, where the
force_update_vcpu_system_time() is called immediately when the new memory
area is registered.

Otherwise, we may observe clock drift at the VM side if the VM accesses
the clocksource immediately after VCPUOP_register_vcpu_info().

Reference: https://lists.xenproject.org/archives/html/xen-devel/2021-10/msg00571.html
Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: b67f09721f136cc3a9afcb6a82466d1bd27aa6c0
master date: 2021-11-03 10:19:06 +0100
xen/arch/arm/time.c
xen/common/domain.c
xen/include/asm-arm/time.h